package com.fanbuchi.fukua.manager;


import android.net.Uri;
import android.provider.MediaStore;

import com.fanbuchi.fukua.entity.UploadEntity;
import com.fanbuchi.fukua.log.AcsfLog;
import com.fanbuchi.fukua.logger.Log;
import com.fanbuchi.fukua.utils.QiniuUtils;
import com.qiniu.android.http.ResponseInfo;
import com.qiniu.android.storage.UpCompletionHandler;
import com.qiniu.android.storage.UploadManager;

import org.json.JSONObject;

import java.io.File;


/**
 * Created by rabbit on 2015/10/17.
 */
public class QiniuManager {

    private static final QiniuManager qiniuManager = new QiniuManager();

    public static QiniuManager getInstance() {
        return qiniuManager;
    }
    private static final UploadManager uplouaManager = new UploadManager();

    public void pciture(UploadEntity uploadEntity){
        uplouaManager.put(new File(uploadEntity.path), "foo/bar.jpg", uploadEntity.uToken,
                new UpCompletionHandler() {
                    @Override
                    public void complete(String key, ResponseInfo info, JSONObject response) {
                        AcsfLog.d("qiniu=", "info=" + info);
                    }
                }, null);
    }







}
